package com.atguigu.lease.web.app.config;

import com.atguigu.lease.web.app.interceptor.AuthenticationInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author liangtianzhe
 */
@Configuration
public class LoginWebMvcConfiguration implements WebMvcConfigurer {

    @Resource
    private AuthenticationInterceptor authenticationInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(authenticationInterceptor)
               .addPathPatterns("/app/**")
               .excludePathPatterns("/app/login/**");
    }
}
